<?php
 
App::uses('CakeSession', 'Model/Datasource');


class Link extends AppModel {
    var $useTable = 'link'; // nome della tabella
    
	public $belongsTo = array(
     'Lang' => array(
            'className'     => 'Category',
            'foreignKey'    => 'lang_id',
          )
     // ,'Bookmaker' => array(
            // 'className'     => 'Bookmaker',
            // 'foreignKey'    => 'bookmaker_id',
          // )
      );
      

    // public function afterFind($results, $primary = false) {
        // // CakeLog::write(LOG_NOTICE,"afterfind: ".json_encode($results));
         // $lang =CakeSession::read("langlist");
         // foreach ($results as $key => $val) {
            // if (isset($val['Link'])) {
                // $results[$key]['Link']['langname'] =$lang[$val['Link']['lang_id']];
            // }
             // if (isset($val['Links'])) {
                // $results[$key]['Links']['langname'] =$lang[$val['Links']['lang_id']];
            // }
        // }
        // return $results;
//         
    // }


}

?>